// axios.defaults.baseURL = "http://cba.itlike.com/public/index.php?s=";

// axios
//   .get(
//     "/api/goods/list&sortType=all&sortPrice=0&categoryId=0&goodsName=酒&page=1"
//   )
//   .then(({ data }) => {
//     console.log(data);
//   });
let ipt = document.querySelector("input");
let btn = document.querySelector(".bottom");
let sear = [];
document.querySelector(".content").addEventListener("change", function (e) {
  console.log(ipt.value);

  localStorage.setItem("name", ipt.value);
  if (ipt.value) {
    sear.push(ipt.value);
    document.querySelector(".right p").addEventListener("click", function () {
      location.href = "../智慧商城/list.html";
      localStorage.setItem("search", ipt.value);
      ipt.value = "";
    });
  }
  localStorage.setItem("hot", sear);
});

let hot = localStorage.getItem("hot").split(",");
console.log(btn.children);
// console.log(btn.innerText === "");
// if (btn.children.length === 0) {
//   document.querySelector(".delete").style.display = "none";
// }
hot.forEach((ele) => {
  btn.innerHTML += `<p class='ellipsis-1'>${ele}</p>`;
});

document.querySelector(".icon-fenlei1").addEventListener("click", function () {
  document.querySelector(".bottom p").remove();
  localStorage.removeItem("hot");
});
